<script type="text/javascript" src="/styles/website/js/javascript.lib.js"></script>
<script type="text/javascript">
function btnRegistry_onclick(){
	if(test_empty($('#txtName').val())){
		alert("Hãy nhập tiêu đề");document.frmMember.txtName.focus();return false;
	}
	if(test_empty($('#txtShort').val())){
		alert("Bạn phải nhập mô tả");document.frmMember.txtShort.focus();return false;
	}
	if(test_integer($('#txtPrice').val())){
		alert("Giá gốc phải là số");document.frmMember.txtPrice.focus();return false;
	}
	if(test_integer($('#txtPer').val())){
		alert("Giá giảm phải là số");document.frmMember.txtPer.focus();return false;
	}
	if(test_empty($('#txtCode').val())){
		alert(mustInput_Robust);document.frmMember.txtCode.focus();return false;
	}
	return true;
}
</script>
<div class="wrapper">
	<h3 class="title_wrapper">{$title}</h3>
	<div style="padding:10px;">
        <div class="info_contact">
            <h4 style="margin-bottom:5px;">CHÚ Ý:</h4>
            Để hỗ trợ cho tin mà bạn đã đăng được lên trên top đầu, bạn phải trả một mức phí tương ứng. Chúng tôi có nhiều gói khuyến mãi cho bạn lựa chọn.<br />
            Để biết thêm chi tiết vui lòng liên hệ số điện thoại 0909.999.999.
        </div><!--info_contact-->
        <link rel="stylesheet" href="/styles/website/css/datepicker.css" type="text/css" />
        <script type="text/javascript" src="/styles/website/js/datepicker.js"></script>
        <script type="text/javascript" src="/styles/website/js/eye.js"></script>
        <script type="text/javascript" src="/styles/website/js/layout.js"></script>
        <div style="margin-top:10px;">
            <form action="{Url::current()}" name="frmMember" method="post" enctype="multipart/form-data">
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Tiêu đề :<font color="#FF0000">*</font></label>
                <input type="text" value="{if isset($product)}{$product.name}{/if}" style="height:22px;line-height:22px;" id="txtName" name="txtName" class="txtContact" />
                <div class="clear"></div>
                 <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Keywords :</label>
                <input type="text" value="{if isset($product)}{$product.keywords}{/if}" style="height:22px;line-height:22px;" name="txtKeys" class="txtContact" />
                <div class="clear"></div>
                 <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Description :</label>
                <input type="text" value="{if isset($product)}{$product.description}{/if}" style="height:22px;line-height:22px;" name="txtDesc" class="txtContact" />
                <div class="clear"></div>
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Mô tả :<font color="#FF0000">*</font></label>
                <textarea name="txtShort" id="txtShort" class="areaContact" rows="3" cols="35" style="height:100px">{if isset($product)}{$product.content_short}{/if}</textarea>
                <div class="clear"></div>
                <script type="text/javascript" src="/styles/website/js/jHtmlArea-0.7.5.js"></script>
                <link rel="Stylesheet" type="text/css" href="/styles/website/css/jHtmlArea.css" />
                <script type="text/javascript">
                    $(function() {
                        $("#txtContent").htmlarea();
                    });
                </script>
                <div class="title_editor">
					Nội dung:
				</div>
                <div class="content_editor">
	               <textarea id="txtContent" name="txtContent" cols="60" rows="8">{if isset($product)}{$product.content}{/if}</textarea>
				</div>
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Giá gốc :<font color="#FF0000">*</font></label>
                <input type="text" value="{if isset($product)}{$product.price}{/if}" style="width:130px;height:22px;line-height:22px;" name="txtPrice" id="txtPrice" class="txtContact" /><label class="lblContact" style="width:25px;padding-left:3px;height:22px;line-height:22px;">VND</label>
                <label class="lblContact" style="width:45px;padding-left:15px;height:22px;line-height:22px;">Giảm :</label>
                <input type="text" value="{if isset($product)}{$product.per}{/if}" name="txtPer" id="txtPer" style="width:60px;height:22px;line-height:22px;" class="txtContact" /><label class="lblContact" style="width:10px;padding-left:5px;"><font color="#FF0000">%</font></label>
                <div class="clear"></div>
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Danh mục :</label>
                <select class="slcPost" name="slcCategory">
                    {foreach $category as $row}
                    	<option value="{$row.id}" {if isset($product.category) && $row.id eq $product.category} selected=""{/if}>{$row.name}</option>
                    {/foreach}
                </select>
                <div class="clear"></div>
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Thời gian KM :</label>
                <label class="lblContact" style="width:80px;height:22px;line-height:22px;text-align:right;">Từ ngày :&nbsp;&nbsp;</label>
                <input type="text" value="{if isset($product.date_start) && $product.date_start neq 0}{date('m/d/Y',strtotime($product.date_start))}{/if}" readonly="readonly" style="width:80px;height:22px;line-height:22px;margin-right:3px;" name="txtDateSt" class="txtContact" id="inputDate1a" />
                <img style="float:left;margin-right:5px;" class="inputDate1a" src="/styles/website/images/calendar.png" alt="" />
                <label class="lblContact" style="width:80px;height:22px;line-height:22px;text-align:right;">Đến ngày :&nbsp;&nbsp;</label>
                <input type="text" value="{if isset($product.date_end) && $product.date_end neq 0}{date('m/d/Y',strtotime($product.date_end))}{/if}" readonly="readonly" style="width:80px;height:22px;line-height:22px;margin-right:3px;" name="txtDateEn" class="txtContact" id="inputDate1b" />
                <img style="float:left;" class="inputDate1b" src="/styles/website/images/calendar.png" alt="" />
                <div class="clear"></div>
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Công ty :</label>
                <input type="text" value="{if isset($product.company)}{$product.company}{/if}" style="height:22px;line-height:22px;" name="txtCompany" class="txtContact" />
                <div class="clear"></div>
                 <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Địa chỉ :</label>
                <input type="text" value="{if isset($product.address)}{$product.address}{/if}" style="height:22px;line-height:22px;" name="txtAddress" class="txtContact" />
                <div class="clear"></div>
                 <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Điện thoại :</label>
                <input type="text" value="{if isset($product.phone)}{$product.phone}{/if}" style="height:22px;line-height:22px;" name="txtPhone" class="txtContact" />
                <div class="clear"></div>
                {if isset($product.images) && $product.images neq ''}<img src="{$product.images}" width="160px" height="100px" alt="image" style="margin-bottom:10px" /><br />{/if}
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Hình ảnh :</label>
                <input type="file" name="images" />
                <div class="clear"></div>
                <p style="margin-top:10px;padding-left:100px;margin-bottom:0;padding-bottom:0;">{$captcha}</p>
                <label class="lblContact" style="width:100px;height:22px;line-height:22px;">Mã xác nhận :<font color="#FF0000">*</font></label>
                <input type="text" style="width:130px;height:22px;line-height:22px;" name="txtCode" id="txtCode" class="txtContact" />
                <div class="clear"></div>
                <label class="lblContact" style="width:100px;">&nbsp;</label>
                <input type="hidden" name="action" value="{$action}" />
                <input type="hidden" name="token" value="{Security::setToken('token_form')}" />
                <input onclick="return btnRegistry_onclick();" name="btnSubmit" type="submit" class="btnContact" value="Gửi" />
                <input type="reset" class="btnContact" value="Xoá" />
            </form>
        </div>
        <div class="clear"></div>
    </div><!--div-->
</div><!--wrapper-->